/**
 * 
 */
package aaaAddr;

 
 
 
import java.util.List;

import org.apache.http.impl.io.DefaultHttpRequestWriterFactory;
import org.openqa.selenium.By;
import org.openqa.selenium.firefox.FirefoxDriver;

import com.attilax.io.filex;
import com.attilax.io.pathx;

/**  aaaAddr.Neteasy163
 * @author attilax
 *2016年4月25日 下午6:07:38
 */
public class Neteasy163 {

	/**
	attilax    2016年4月25日  下午6:07:38
	 * @param args
	 */
	public static void main(String[] args) {
	//	org.apache.http.impl.io.DefaultHttpRequestWriterFactory
	// DefaultHttpRequestWriterFactory C:\0workspace 空格\AtiPlatf_auto\dic
		List<String>  li=filex.read2list("$root$/dic");
		for (String line : li) {
			String[] a=line.split(",");
			String name=a[0];
			String pwd=a[1];
			String pubUrl="http://reg.email.163.com/unireg/call.do?cmd=register.entrance&from=163navi&regPage=163";
			String ffpath = pathx.webAppPath()
					+ "\\Mozilla Firefox\\firefox.exe";
			System.setProperty("webdriver.firefox.bin", ffpath);
			FirefoxDriver driver =null;
			driver = new FirefoxDriver();
			driver.get(pubUrl);
		      driver.findElement(By.id("mobileIpt")).clear();
			driver.findElement(By.id("mobileIpt")).sendKeys(name);
			   driver.findElement(By.id("mVcodeIpt")).clear();
				driver.findElement(By.id("mVcodeIpt")).sendKeys("1857");
				driver.findElement(By.id("sendAcodeBtn")).click();
				driver.findElement(By.id("sendAcodeStg")).click();
				
				
				   driver.findElement(By.id("mobilePwdIpt")).clear();
					driver.findElement(By.id("mobilePwdIpt")).sendKeys("18573344544");
					  driver.findElement(By.id("mobileCfmPwdIpt")).clear();
						driver.findElement(By.id("mobileCfmPwdIpt")).sendKeys("18573344544");
		}
		
			
				
		
	}

}
